/*
 Navicat MySQL Data Transfer

 Source Server         : 129
 Source Server Type    : MySQL
 Source Server Version : 50553
 Source Host           : 121.40.178.129
 Source Database       : lslease

 Target Server Type    : MySQL
 Target Server Version : 50553
 File Encoding         : utf-8

 Date: 10/18/2017 14:47:56 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `app_furniture`
-- ----------------------------
DROP TABLE IF EXISTS `app_furniture`;
CREATE TABLE `app_furniture` (
  `furniture_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '设施ID',
  `washing_machine_flag` int(11) NOT NULL DEFAULT '1' COMMENT '是否有洗衣机 1 有 2 没有',
  `micro_wave_oven_flag` int(11) NOT NULL DEFAULT '2' COMMENT '是否有微波炉 1 有 2 无',
  `refrigerator_flag` int(11) NOT NULL DEFAULT '1' COMMENT '是否有冰箱 1 有 2 无',
  `range_hood_flag` int(11) NOT NULL DEFAULT '1' COMMENT '是否有油烟机 1 有 2 无',
  `sofa_flag` int(11) NOT NULL DEFAULT '2' COMMENT '是否有沙发 1 有 2 无',
  `bed_flag` int(11) NOT NULL DEFAULT '1' COMMENT '是否有床 1 有 2 无',
  `desk` int(11) NOT NULL DEFAULT '2' COMMENT '是否有桌子 1 有 2 无',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`furniture_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='房源配套家具表';

-- ----------------------------
--  Table structure for `app_house`
-- ----------------------------
DROP TABLE IF EXISTS `app_house`;
CREATE TABLE `app_house` (
  `house_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '房源ID',
  `house_name` varchar(200) NOT NULL COMMENT '房源名称',
  `company_id` int(11) NOT NULL COMMENT '公司ID',
  `landlord_id` int(11) NOT NULL COMMENT '房东ID',
  `suite` int(11) NOT NULL COMMENT '是否是套间 1 是 2 不是',
  `house_address` varchar(200) NOT NULL COMMENT '房源地址',
  `house_pic_id` int(11) DEFAULT NULL COMMENT '房源图片',
  `house_ furniture_id` int(11) DEFAULT NULL COMMENT '房源配套家具',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`house_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='房源表';

-- ----------------------------
--  Table structure for `app_landlord`
-- ----------------------------
DROP TABLE IF EXISTS `app_landlord`;
CREATE TABLE `app_landlord` (
  `landlord_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL COMMENT '系统用户表中用户ID',
  `landlord_name` varchar(50) NOT NULL COMMENT '房东的名字，区别与房东在系统用户表中的名字',
  `address` varchar(255) DEFAULT NULL COMMENT '房东固定的家庭住址',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`landlord_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='房东表';

-- ----------------------------
--  Table structure for `app_lock`
-- ----------------------------
DROP TABLE IF EXISTS `app_lock`;
CREATE TABLE `app_lock` (
  `lock_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '锁的ID',
  `hourse_id` int(11) DEFAULT NULL COMMENT '房源ID',
  `room_id` int(11) DEFAULT NULL COMMENT '房间ID',
  `lock_name` varchar(20) NOT NULL COMMENT '锁的名称',
  `lock_password` varchar(50) DEFAULT NULL COMMENT '锁默认的开门密码(属于房东管理该设备的永久开门密码)',
  `mac_address` varchar(20) NOT NULL COMMENT '锁的mac地址',
  `socket_id` int(11) DEFAULT NULL COMMENT '锁关联的插座ID',
  `open_record_flag` int(1) NOT NULL DEFAULT '1' COMMENT '开门记录上传功能是否开启 1 未开启 2 已开启',
  `fireware_version` varchar(50) NOT NULL COMMENT '锁的固件版本号',
  `max_user_num` int(11) NOT NULL COMMENT '锁的最大用户数',
  `used_user_num` int(11) NOT NULL COMMENT '锁的已用的用户数',
  `battery` varchar(5) DEFAULT NULL COMMENT '电量信息',
  `battery_state` int(1) NOT NULL DEFAULT '1' COMMENT '电量状态 1 正常电量 2 低电量',
  `locked_state` int(1) NOT NULL DEFAULT '1' COMMENT '是否上锁 1 已上锁 2 未上锁',
  `online_state` int(1) NOT NULL DEFAULT '1' COMMENT '是否联网 1 未联网 2 已联网',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`lock_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='锁具信息表(房源或房间与设备的关联表,添加设备时,房源信息ID或房间信息ID必须至少有一个)';

-- ----------------------------
--  Table structure for `app_lock_openrecord`
-- ----------------------------
DROP TABLE IF EXISTS `app_lock_openrecord`;
CREATE TABLE `app_lock_openrecord` (
  `open_record_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '开门记录ID',
  `open_identify` varchar(50) NOT NULL COMMENT '开门标识，用户指纹和手机开门时为用户ID，密码开门时为固定字符串LOCK-PASSWORD，无法识别时为UNKNOWN',
  `lock_id` int(11) NOT NULL COMMENT '锁的ID',
  `open_type` int(3) NOT NULL DEFAULT '64' COMMENT '开门方式 1 手机 2 指纹 4 密码 128 未知 ',
  `open_time` datetime NOT NULL,
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`open_record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='开门记录表';

-- ----------------------------
--  Table structure for `app_lock_temppwd`
-- ----------------------------
DROP TABLE IF EXISTS `app_lock_temppwd`;
CREATE TABLE `app_lock_temppwd` (
  `temppwd_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '临时密码ID',
  `lock_id` int(11) NOT NULL COMMENT '锁的ID',
  `generate_user_id` int(11) NOT NULL COMMENT '产生临时密码的用户ID',
  `temp_pwd` varchar(255) NOT NULL COMMENT '单个临时密码',
  `state` int(1) NOT NULL DEFAULT '1' COMMENT '临时密码状态 1 未使用 2 已使用',
  `shared_user_id` int(11) NOT NULL COMMENT '被分享的用户的ID',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`temppwd_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='临时密码表';

-- ----------------------------
--  Table structure for `app_lock_tenant`
-- ----------------------------
DROP TABLE IF EXISTS `app_lock_tenant`;
CREATE TABLE `app_lock_tenant` (
  `tenant_lock_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL COMMENT '租客ID',
  `user_lock_id` int(11) NOT NULL COMMENT '锁ID',
  `user_lock_password` varchar(50) DEFAULT NULL COMMENT '用户的锁的开锁密码',
  `user_lock_name` varchar(50) NOT NULL COMMENT '用户的锁的名字',
  `user_lock_open_music` int(11) DEFAULT NULL COMMENT '用户的锁的开锁提示音',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`tenant_lock_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='租客与设备的关联表';

-- ----------------------------
--  Table structure for `app_message_code`
-- ----------------------------
DROP TABLE IF EXISTS `app_message_code`;
CREATE TABLE `app_message_code` (
  `short_num_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '验证码ID',
  `user_mobile_account` varchar(20) NOT NULL COMMENT '用户手机号码，因为系统用户在注册获取验证码时，系统并没有该用户的信息，不能用用户ID',
  `user_short_num` varchar(20) NOT NULL COMMENT '验证码',
  `msgState` int(11) NOT NULL COMMENT '验证码状态 1 未使用 2 已使用',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `remark` varchar(256) DEFAULT NULL,
  `item1` varchar(256) DEFAULT NULL,
  `item2` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`short_num_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='手机获取验证码信息表';

-- ----------------------------
--  Records of `app_message_code`
-- ----------------------------
BEGIN;
INSERT INTO `app_message_code` VALUES ('1', '18668165280', '5426', '2', '2017-10-17 14:11:03', '2017-10-17 15:14:13', '验证验证码', null, null), ('2', '18668165280', '2067', '2', '2017-10-17 15:10:12', '2017-10-17 15:14:13', '验证验证码', null, null), ('3', '18668165280', '6576', '2', '2017-10-17 15:13:56', '2017-10-17 15:14:13', '验证验证码', null, null);
COMMIT;

-- ----------------------------
--  Table structure for `app_pic`
-- ----------------------------
DROP TABLE IF EXISTS `app_pic`;
CREATE TABLE `app_pic` (
  `pic_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '房源图片ID',
  `pic1` varchar(255) DEFAULT NULL,
  `pic2` varchar(255) DEFAULT NULL,
  `pci3` varchar(255) DEFAULT NULL,
  `pic4` varchar(255) DEFAULT NULL,
  `pic5` varchar(255) DEFAULT NULL,
  `pic6` varchar(255) DEFAULT NULL,
  `pic7` varchar(255) DEFAULT NULL,
  `pic8` varchar(255) DEFAULT NULL,
  `pic9` varchar(255) DEFAULT NULL,
  `pic10` varchar(255) DEFAULT NULL,
  `pic11` varchar(255) DEFAULT NULL,
  `pic12` varchar(255) DEFAULT NULL,
  `pic13` varchar(255) DEFAULT NULL,
  `pic14` varchar(255) DEFAULT NULL,
  `pic15` varchar(255) DEFAULT NULL,
  `pic16` varchar(255) DEFAULT NULL,
  `pic17` varchar(255) DEFAULT NULL,
  `pic18` varchar(255) DEFAULT NULL,
  `pic19` varchar(255) DEFAULT NULL,
  `pic20` varchar(255) DEFAULT NULL,
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`pic_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='房源图片表';

-- ----------------------------
--  Table structure for `app_room`
-- ----------------------------
DROP TABLE IF EXISTS `app_room`;
CREATE TABLE `app_room` (
  `room_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '房间ID',
  `house_id` int(11) NOT NULL COMMENT '房源ID',
  `floor_num` int(11) NOT NULL COMMENT '楼层',
  `room_num` int(11) NOT NULL COMMENT '房间编号',
  `room_name` varchar(50) NOT NULL COMMENT '房间名称',
  `pic_id` int(11) DEFAULT NULL COMMENT '房间图片ID',
  `furniture_id` int(11) DEFAULT NULL COMMENT '家具ID',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`room_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='房源中的某个房间的信息表';

-- ----------------------------
--  Table structure for `app_socket`
-- ----------------------------
DROP TABLE IF EXISTS `app_socket`;
CREATE TABLE `app_socket` (
  `socket_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '插座ID',
  `manage_user_id` int(11) NOT NULL COMMENT '添加插座的用户ID',
  `socket_name` varchar(50) NOT NULL COMMENT '插座名称',
  `socket_mac` varchar(20) NOT NULL COMMENT '插座mac地址',
  `wifi_ssid` varchar(50) DEFAULT NULL,
  `wifi_password` varchar(50) DEFAULT NULL,
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`socket_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='插座表';

-- ----------------------------
--  Table structure for `app_sys_role`
-- ----------------------------
DROP TABLE IF EXISTS `app_sys_role`;
CREATE TABLE `app_sys_role` (
  `role_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '角色ID',
  `name` varchar(20) NOT NULL COMMENT '角色名称',
  `type` int(3) NOT NULL DEFAULT '1' COMMENT '角色类型 -1未知角色 1 系统用户 2 租客 4 房东 8 既是房东又是租客',
  `remark` varchar(20) DEFAULT NULL COMMENT '角色备注',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10015 DEFAULT CHARSET=utf8 COMMENT='用户角色表';

-- ----------------------------
--  Records of `app_sys_role`
-- ----------------------------
BEGIN;
INSERT INTO `app_sys_role` VALUES ('10000', '未知角色', '-1', '添加角色'), ('10001', '系统用户', '1', '添加角色'), ('10002', '租客', '2', '添加角色'), ('10003', '房东', '4', '添加角色'), ('10004', '既是租客也是房东', '8', '添加角色');
COMMIT;

-- ----------------------------
--  Table structure for `app_sys_user`
-- ----------------------------
DROP TABLE IF EXISTS `app_sys_user`;
CREATE TABLE `app_sys_user` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `mobile` varchar(15) NOT NULL COMMENT '手机号码',
  `wechat_open_id` varchar(100) NOT NULL COMMENT '微信openid',
  `qq` varchar(20) DEFAULT NULL COMMENT 'QQ号码',
  `nick_name` varchar(20) DEFAULT NULL COMMENT '用户昵称',
  `photo` varchar(255) DEFAULT NULL COMMENT '用户图像',
  `password` varchar(128) DEFAULT NULL COMMENT '用户密码，建议至少MD5加密',
  `email` varchar(50) DEFAULT NULL COMMENT '用户邮箱',
  `birthday` date DEFAULT NULL COMMENT '用户生日',
  `state` int(3) NOT NULL DEFAULT '1' COMMENT '用户状态 1 正常 2 已禁用 4 已删除',
  `insert_time` datetime DEFAULT NULL COMMENT '记录插入时间',
  `update_time` datetime DEFAULT NULL COMMENT '记录更新时间',
  `remark` varchar(50) DEFAULT NULL COMMENT '备注',
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10004 DEFAULT CHARSET=utf8 COMMENT='系统用户表';

-- ----------------------------
--  Records of `app_sys_user`
-- ----------------------------
BEGIN;
INSERT INTO `app_sys_user` VALUES ('10003', '18668165280', 'wechat000022222kkkkkddd111111pppppp', null, '用户5280', null, null, null, null, '1', '2017-10-18 13:54:08', '2017-10-18 13:54:08', '绑定微信账号', null, null, null, null, null);
COMMIT;

-- ----------------------------
--  Table structure for `app_sys_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `app_sys_user_role`;
CREATE TABLE `app_sys_user_role` (
  `sys_user_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户角色关联ID',
  `user_id` int(11) NOT NULL COMMENT '用户ID',
  `role_id` int(11) NOT NULL,
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`sys_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=utf8 COMMENT='用户与角色关联表';

-- ----------------------------
--  Records of `app_sys_user_role`
-- ----------------------------
BEGIN;
INSERT INTO `app_sys_user_role` VALUES ('10002', '10003', '10001', '2017-10-18 13:54:08', '2017-10-18 13:54:08', null, null);
COMMIT;

-- ----------------------------
--  Table structure for `app_tenant_repairs`
-- ----------------------------
DROP TABLE IF EXISTS `app_tenant_repairs`;
CREATE TABLE `app_tenant_repairs` (
  `repair_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '报修ID',
  `user_id` int(11) NOT NULL COMMENT '租客ID',
  `landlord_id` int(11) NOT NULL COMMENT '房东ID',
  `repair_room_id` int(11) NOT NULL COMMENT '报修的房间ID',
  `title` varchar(50) NOT NULL COMMENT '报修标题',
  `content` varchar(800) NOT NULL COMMENT '报修内容',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`repair_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='租客报修表';

-- ----------------------------
--  Table structure for `app_tenant_room`
-- ----------------------------
DROP TABLE IF EXISTS `app_tenant_room`;
CREATE TABLE `app_tenant_room` (
  `tenant_room_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL COMMENT '系统用户表中的用户ID',
  `room_id` int(11) NOT NULL COMMENT '房间ID',
  `check_date` date NOT NULL COMMENT '入住日期',
  `dead_date` date NOT NULL COMMENT '到期日期',
  `rent_days` int(11) NOT NULL COMMENT '租住天数，等于到期日期减去入住日期的时间段换算成的天数',
  `insert_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `item1` varchar(50) DEFAULT NULL,
  `item2` varchar(50) DEFAULT NULL,
  `item3` varchar(50) DEFAULT NULL,
  `item4` varchar(50) DEFAULT NULL,
  `item5` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`tenant_room_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT='租客表(房间与用户的关联表)';

-- ----------------------------
--  Table structure for `qrtz_blob_triggers`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_blob_triggers`;
CREATE TABLE `qrtz_blob_triggers` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `TRIGGER_NAME` varchar(200) NOT NULL,
  `TRIGGER_GROUP` varchar(200) NOT NULL,
  `BLOB_DATA` blob,
  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qrtz_calendars`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_calendars`;
CREATE TABLE `qrtz_calendars` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `CALENDAR_NAME` varchar(200) NOT NULL,
  `CALENDAR` blob NOT NULL,
  PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qrtz_cron_triggers`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_cron_triggers`;
CREATE TABLE `qrtz_cron_triggers` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `TRIGGER_NAME` varchar(200) NOT NULL,
  `TRIGGER_GROUP` varchar(200) NOT NULL,
  `CRON_EXPRESSION` varchar(120) NOT NULL,
  `TIME_ZONE_ID` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `qrtz_cron_triggers`
-- ----------------------------
BEGIN;
INSERT INTO `qrtz_cron_triggers` VALUES ('RenrenScheduler', 'TASK_1', 'DEFAULT', '0 0/30 * * * ?', 'Asia/Shanghai'), ('RenrenScheduler', 'TASK_2', 'DEFAULT', '0 0/30 * * * ?', 'Asia/Shanghai');
COMMIT;

-- ----------------------------
--  Table structure for `qrtz_fired_triggers`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_fired_triggers`;
CREATE TABLE `qrtz_fired_triggers` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `ENTRY_ID` varchar(95) NOT NULL,
  `TRIGGER_NAME` varchar(200) NOT NULL,
  `TRIGGER_GROUP` varchar(200) NOT NULL,
  `INSTANCE_NAME` varchar(200) NOT NULL,
  `FIRED_TIME` bigint(13) NOT NULL,
  `SCHED_TIME` bigint(13) NOT NULL,
  `PRIORITY` int(11) NOT NULL,
  `STATE` varchar(16) NOT NULL,
  `JOB_NAME` varchar(200) DEFAULT NULL,
  `JOB_GROUP` varchar(200) DEFAULT NULL,
  `IS_NONCONCURRENT` varchar(1) DEFAULT NULL,
  `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL,
  PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`),
  KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`),
  KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`),
  KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`),
  KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qrtz_job_details`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_job_details`;
CREATE TABLE `qrtz_job_details` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `JOB_NAME` varchar(200) NOT NULL,
  `JOB_GROUP` varchar(200) NOT NULL,
  `DESCRIPTION` varchar(250) DEFAULT NULL,
  `JOB_CLASS_NAME` varchar(250) NOT NULL,
  `IS_DURABLE` varchar(1) NOT NULL,
  `IS_NONCONCURRENT` varchar(1) NOT NULL,
  `IS_UPDATE_DATA` varchar(1) NOT NULL,
  `REQUESTS_RECOVERY` varchar(1) NOT NULL,
  `JOB_DATA` blob,
  PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`),
  KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `qrtz_job_details`
-- ----------------------------
BEGIN;
INSERT INTO `qrtz_job_details` VALUES ('RenrenScheduler', 'TASK_1', 'DEFAULT', null, 'io.renren.modules.job.utils.ScheduleJob', '0', '0', '0', '0', 0xaced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787001737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000d4a4f425f504152414d5f4b45597400b67b226a6f624964223a312c226265616e4e616d65223a22746573745461736b222c226d6574686f644e616d65223a2274657374222c22706172616d73223a2272656e72656e222c2263726f6e45787072657373696f6e223a223020302f3330202a202a202a203f222c22737461747573223a302c2272656d61726b223a22e69c89e58f82e695b0e6b58be8af95222c2263726561746554696d65223a2244656320312c20323031362031313a31363a343620504d227d7800), ('RenrenScheduler', 'TASK_2', 'DEFAULT', null, 'io.renren.modules.job.utils.ScheduleJob', '0', '0', '0', '0', 0xaced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787001737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000d4a4f425f504152414d5f4b45597400a47b226a6f624964223a322c226265616e4e616d65223a22746573745461736b222c226d6574686f644e616d65223a227465737432222c2263726f6e45787072657373696f6e223a223020302f3330202a202a202a203f222c22737461747573223a312c2272656d61726b223a22e697a0e58f82e695b0e6b58be8af95222c2263726561746554696d65223a2244656320332c203230313620323a35353a353620504d227d7800);
COMMIT;

-- ----------------------------
--  Table structure for `qrtz_locks`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_locks`;
CREATE TABLE `qrtz_locks` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `LOCK_NAME` varchar(40) NOT NULL,
  PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `qrtz_locks`
-- ----------------------------
BEGIN;
INSERT INTO `qrtz_locks` VALUES ('RenrenScheduler', 'STATE_ACCESS'), ('RenrenScheduler', 'TRIGGER_ACCESS');
COMMIT;

-- ----------------------------
--  Table structure for `qrtz_paused_trigger_grps`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_paused_trigger_grps`;
CREATE TABLE `qrtz_paused_trigger_grps` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `TRIGGER_GROUP` varchar(200) NOT NULL,
  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qrtz_scheduler_state`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_scheduler_state`;
CREATE TABLE `qrtz_scheduler_state` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `INSTANCE_NAME` varchar(200) NOT NULL,
  `LAST_CHECKIN_TIME` bigint(13) NOT NULL,
  `CHECKIN_INTERVAL` bigint(13) NOT NULL,
  PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `qrtz_scheduler_state`
-- ----------------------------
BEGIN;
INSERT INTO `qrtz_scheduler_state` VALUES ('RenrenScheduler', 'iZbp10rtmlr71ju32fzvyaZ1508308863063', '1508309271818', '15000');
COMMIT;

-- ----------------------------
--  Table structure for `qrtz_simple_triggers`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_simple_triggers`;
CREATE TABLE `qrtz_simple_triggers` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `TRIGGER_NAME` varchar(200) NOT NULL,
  `TRIGGER_GROUP` varchar(200) NOT NULL,
  `REPEAT_COUNT` bigint(7) NOT NULL,
  `REPEAT_INTERVAL` bigint(12) NOT NULL,
  `TIMES_TRIGGERED` bigint(10) NOT NULL,
  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  CONSTRAINT `qrtz_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qrtz_simprop_triggers`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_simprop_triggers`;
CREATE TABLE `qrtz_simprop_triggers` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `TRIGGER_NAME` varchar(200) NOT NULL,
  `TRIGGER_GROUP` varchar(200) NOT NULL,
  `STR_PROP_1` varchar(512) DEFAULT NULL,
  `STR_PROP_2` varchar(512) DEFAULT NULL,
  `STR_PROP_3` varchar(512) DEFAULT NULL,
  `INT_PROP_1` int(11) DEFAULT NULL,
  `INT_PROP_2` int(11) DEFAULT NULL,
  `LONG_PROP_1` bigint(20) DEFAULT NULL,
  `LONG_PROP_2` bigint(20) DEFAULT NULL,
  `DEC_PROP_1` decimal(13,4) DEFAULT NULL,
  `DEC_PROP_2` decimal(13,4) DEFAULT NULL,
  `BOOL_PROP_1` varchar(1) DEFAULT NULL,
  `BOOL_PROP_2` varchar(1) DEFAULT NULL,
  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  CONSTRAINT `qrtz_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `qrtz_triggers`
-- ----------------------------
DROP TABLE IF EXISTS `qrtz_triggers`;
CREATE TABLE `qrtz_triggers` (
  `SCHED_NAME` varchar(120) NOT NULL,
  `TRIGGER_NAME` varchar(200) NOT NULL,
  `TRIGGER_GROUP` varchar(200) NOT NULL,
  `JOB_NAME` varchar(200) NOT NULL,
  `JOB_GROUP` varchar(200) NOT NULL,
  `DESCRIPTION` varchar(250) DEFAULT NULL,
  `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL,
  `PREV_FIRE_TIME` bigint(13) DEFAULT NULL,
  `PRIORITY` int(11) DEFAULT NULL,
  `TRIGGER_STATE` varchar(16) NOT NULL,
  `TRIGGER_TYPE` varchar(8) NOT NULL,
  `START_TIME` bigint(13) NOT NULL,
  `END_TIME` bigint(13) DEFAULT NULL,
  `CALENDAR_NAME` varchar(200) DEFAULT NULL,
  `MISFIRE_INSTR` smallint(2) DEFAULT NULL,
  `JOB_DATA` blob,
  PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
  KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
  KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`),
  KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`),
  KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`),
  KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`),
  KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`),
  KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`),
  KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`),
  KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`),
  KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
  CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `qrtz_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `qrtz_triggers`
-- ----------------------------
BEGIN;
INSERT INTO `qrtz_triggers` VALUES ('RenrenScheduler', 'TASK_1', 'DEFAULT', 'TASK_1', 'DEFAULT', null, '1508310000000', '-1', '5', 'WAITING', 'CRON', '1508228491000', '0', null, '2', 0xaced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787001737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000d4a4f425f504152414d5f4b45597400b67b226a6f624964223a312c226265616e4e616d65223a22746573745461736b222c226d6574686f644e616d65223a2274657374222c22706172616d73223a2272656e72656e222c2263726f6e45787072657373696f6e223a223020302f3330202a202a202a203f222c22737461747573223a302c2272656d61726b223a22e69c89e58f82e695b0e6b58be8af95222c2263726561746554696d65223a2244656320312c20323031362031313a31363a343620504d227d7800), ('RenrenScheduler', 'TASK_2', 'DEFAULT', 'TASK_2', 'DEFAULT', null, '1508229000000', '-1', '5', 'PAUSED', 'CRON', '1508228491000', '0', null, '2', 0xaced0005737200156f72672e71756172747a2e4a6f62446174614d61709fb083e8bfa9b0cb020000787200266f72672e71756172747a2e7574696c732e537472696e674b65794469727479466c61674d61708208e8c3fbc55d280200015a0013616c6c6f77735472616e7369656e74446174617872001d6f72672e71756172747a2e7574696c732e4469727479466c61674d617013e62ead28760ace0200025a000564697274794c00036d617074000f4c6a6176612f7574696c2f4d61703b787001737200116a6176612e7574696c2e486173684d61700507dac1c31660d103000246000a6c6f6164466163746f724900097468726573686f6c6478703f4000000000000c7708000000100000000174000d4a4f425f504152414d5f4b45597400a47b226a6f624964223a322c226265616e4e616d65223a22746573745461736b222c226d6574686f644e616d65223a227465737432222c2263726f6e45787072657373696f6e223a223020302f3330202a202a202a203f222c22737461747573223a312c2272656d61726b223a22e697a0e58f82e695b0e6b58be8af95222c2263726561746554696d65223a2244656320332c203230313620323a35353a353620504d227d7800);
COMMIT;

-- ----------------------------
--  Table structure for `schedule_job`
-- ----------------------------
DROP TABLE IF EXISTS `schedule_job`;
CREATE TABLE `schedule_job` (
  `job_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务id',
  `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
  `method_name` varchar(100) DEFAULT NULL COMMENT '方法名',
  `params` varchar(2000) DEFAULT NULL COMMENT '参数',
  `cron_expression` varchar(100) DEFAULT NULL COMMENT 'cron表达式',
  `status` tinyint(4) DEFAULT NULL COMMENT '任务状态  0：正常  1：暂停',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`job_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='定时任务';

-- ----------------------------
--  Records of `schedule_job`
-- ----------------------------
BEGIN;
INSERT INTO `schedule_job` VALUES ('1', 'testTask', 'test', 'renren', '0 0/30 * * * ?', '0', '有参数测试', '2016-12-01 23:16:46'), ('2', 'testTask', 'test2', null, '0 0/30 * * * ?', '1', '无参数测试', '2016-12-03 14:55:56');
COMMIT;

-- ----------------------------
--  Table structure for `schedule_job_log`
-- ----------------------------
DROP TABLE IF EXISTS `schedule_job_log`;
CREATE TABLE `schedule_job_log` (
  `log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id',
  `job_id` bigint(20) NOT NULL COMMENT '任务id',
  `bean_name` varchar(200) DEFAULT NULL COMMENT 'spring bean名称',
  `method_name` varchar(100) DEFAULT NULL COMMENT '方法名',
  `params` varchar(2000) DEFAULT NULL COMMENT '参数',
  `status` tinyint(4) NOT NULL COMMENT '任务状态    0：成功    1：失败',
  `error` varchar(2000) DEFAULT NULL COMMENT '失败信息',
  `times` int(11) NOT NULL COMMENT '耗时(单位：毫秒)',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`log_id`),
  KEY `job_id` (`job_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='定时任务日志';

-- ----------------------------
--  Records of `schedule_job_log`
-- ----------------------------
BEGIN;
INSERT INTO `schedule_job_log` VALUES ('1', '1', 'testTask', 'test', 'renren', '0', null, '1047', '2017-10-17 17:00:00'), ('2', '1', 'testTask', 'test', 'renren', '0', null, '1061', '2017-10-17 17:30:00'), ('3', '1', 'testTask', 'test', 'renren', '0', null, '1017', '2017-10-17 18:00:00'), ('4', '1', 'testTask', 'test', 'renren', '0', null, '1018', '2017-10-17 18:30:00'), ('5', '1', 'testTask', 'test', 'renren', '0', null, '1014', '2017-10-17 19:00:00'), ('6', '1', 'testTask', 'test', 'renren', '0', null, '1018', '2017-10-17 19:30:00'), ('7', '1', 'testTask', 'test', 'renren', '0', null, '1050', '2017-10-18 09:30:00'), ('8', '1', 'testTask', 'test', 'renren', '0', null, '1038', '2017-10-18 10:00:00'), ('9', '1', 'testTask', 'test', 'renren', '0', null, '1062', '2017-10-18 11:00:00'), ('10', '1', 'testTask', 'test', 'renren', '0', null, '1017', '2017-10-18 11:30:00'), ('11', '1', 'testTask', 'test', 'renren', '0', null, '1008', '2017-10-18 12:00:00'), ('12', '1', 'testTask', 'test', 'renren', '0', null, '1009', '2017-10-18 12:30:00'), ('13', '1', 'testTask', 'test', 'renren', '0', null, '1064', '2017-10-18 13:00:00'), ('14', '1', 'testTask', 'test', 'renren', '0', null, '1074', '2017-10-18 13:30:00'), ('15', '1', 'testTask', 'test', 'renren', '0', null, '1056', '2017-10-18 14:00:00'), ('16', '1', 'testTask', 'test', 'renren', '0', null, '1007', '2017-10-18 14:30:00');
COMMIT;

-- ----------------------------
--  Table structure for `sys_config`
-- ----------------------------
DROP TABLE IF EXISTS `sys_config`;
CREATE TABLE `sys_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `key` varchar(50) DEFAULT NULL COMMENT 'key',
  `value` varchar(2000) DEFAULT NULL COMMENT 'value',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态   0：隐藏   1：显示',
  `remark` varchar(500) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  UNIQUE KEY `key` (`key`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='系统配置信息表';

-- ----------------------------
--  Records of `sys_config`
-- ----------------------------
BEGIN;
INSERT INTO `sys_config` VALUES ('1', 'CLOUD_STORAGE_CONFIG_KEY', '{\"aliyunAccessKeyId\":\"\",\"aliyunAccessKeySecret\":\"\",\"aliyunBucketName\":\"\",\"aliyunDomain\":\"\",\"aliyunEndPoint\":\"\",\"aliyunPrefix\":\"\",\"qcloudBucketName\":\"\",\"qcloudDomain\":\"\",\"qcloudPrefix\":\"\",\"qcloudSecretId\":\"\",\"qcloudSecretKey\":\"\",\"qiniuAccessKey\":\"NrgMfABZxWLo5B-YYSjoE8-AZ1EISdi1Z3ubLOeZ\",\"qiniuBucketName\":\"ios-app\",\"qiniuDomain\":\"http://7xqbwh.dl1.z0.glb.clouddn.com\",\"qiniuPrefix\":\"upload\",\"qiniuSecretKey\":\"uIwJHevMRWU0VLxFvgy0tAcOdGqasdtVlJkdy6vV\",\"type\":1}', '0', '云存储配置信息');
COMMIT;

-- ----------------------------
--  Table structure for `sys_dept`
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
  `dept_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) DEFAULT NULL COMMENT '上级部门ID，一级部门为0',
  `name` varchar(50) DEFAULT NULL COMMENT '部门名称',
  `order_num` int(11) DEFAULT NULL COMMENT '排序',
  `del_flag` tinyint(4) DEFAULT '0' COMMENT '是否删除  -1：已删除  0：正常',
  PRIMARY KEY (`dept_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='部门管理';

-- ----------------------------
--  Records of `sys_dept`
-- ----------------------------
BEGIN;
INSERT INTO `sys_dept` VALUES ('1', '0', '运营平台-总公司', '0', '0'), ('2', '1', 'XX公司', '1', '0'), ('3', '1', '上海分公司', '2', '-1'), ('4', '3', '技术部', '0', '-1'), ('5', '3', '销售部', '1', '-1');
COMMIT;

-- ----------------------------
--  Table structure for `sys_log`
-- ----------------------------
DROP TABLE IF EXISTS `sys_log`;
CREATE TABLE `sys_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) DEFAULT NULL COMMENT '用户名',
  `operation` varchar(50) DEFAULT NULL COMMENT '用户操作',
  `method` varchar(200) DEFAULT NULL COMMENT '请求方法',
  `params` varchar(5000) DEFAULT NULL COMMENT '请求参数',
  `time` bigint(20) NOT NULL COMMENT '执行时长(毫秒)',
  `ip` varchar(64) DEFAULT NULL COMMENT 'IP地址',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='系统日志';

-- ----------------------------
--  Records of `sys_log`
-- ----------------------------
BEGIN;
INSERT INTO `sys_log` VALUES ('1', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '{\"menuId\":4,\"parentId\":1,\"parentName\":\"系统管理\",\"name\":\"公司管理\",\"url\":\"modules/sys/menu.html\",\"type\":1,\"icon\":\"fa fa-th-list\",\"orderNum\":3}', '27', '0:0:0:0:0:0:0:1', '2017-10-18 10:06:13'), ('2', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '{\"menuId\":4,\"parentId\":1,\"parentName\":\"系统管理\",\"name\":\"菜单管理\",\"url\":\"modules/sys/menu.html\",\"type\":1,\"icon\":\"fa fa-th-list\",\"orderNum\":3}', '23', '0:0:0:0:0:0:0:1', '2017-10-18 10:08:59'), ('3', 'admin', '修改菜单', 'io.renren.modules.sys.controller.SysMenuController.update()', '{\"menuId\":31,\"parentId\":1,\"parentName\":\"系统管理\",\"name\":\"公司管理\",\"url\":\"modules/sys/dept.html\",\"type\":1,\"icon\":\"fa fa-file-code-o\",\"orderNum\":1}', '25', '0:0:0:0:0:0:0:1', '2017-10-18 10:09:17'), ('4', 'admin', '修改用户', 'io.renren.modules.sys.controller.SysUserController.update()', '{\"operateUserId\":1,\"username\":\"admin\",\"salt\":\"YzcmCZNvbXocrsz9dm8e\",\"email\":\"root@renren.io\",\"mobile\":\"13612345678\",\"status\":1,\"roleIdList\":[],\"createUserId\":1,\"createTime\":\"Nov 11, 2016 11:11:11 AM\",\"deptId\":1,\"deptName\":\"运营平台-总公司\"}', '89', '0:0:0:0:0:0:0:1', '2017-10-18 10:09:32');
COMMIT;

-- ----------------------------
--  Table structure for `sys_menu`
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `menu_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) DEFAULT NULL COMMENT '父菜单ID，一级菜单为0',
  `name` varchar(50) DEFAULT NULL COMMENT '菜单名称',
  `url` varchar(200) DEFAULT NULL COMMENT '菜单URL',
  `perms` varchar(500) DEFAULT NULL COMMENT '授权(多个用逗号分隔，如：user:list,user:create)',
  `type` int(11) DEFAULT NULL COMMENT '类型   0：目录   1：菜单   2：按钮',
  `icon` varchar(50) DEFAULT NULL COMMENT '菜单图标',
  `order_num` int(11) DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 COMMENT='菜单管理';

-- ----------------------------
--  Records of `sys_menu`
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` VALUES ('1', '0', '系统管理', null, null, '0', 'fa fa-cog', '0'), ('2', '1', '管理员管理', 'modules/sys/user.html', null, '1', 'fa fa-user', '1'), ('3', '1', '角色管理', 'modules/sys/role.html', null, '1', 'fa fa-user-secret', '2'), ('4', '1', '菜单管理', 'modules/sys/menu.html', null, '1', 'fa fa-th-list', '3'), ('5', '1', 'SQL监控', 'druid/sql.html', null, '1', 'fa fa-bug', '4'), ('6', '1', '定时任务', 'modules/job/schedule.html', null, '1', 'fa fa-tasks', '5'), ('7', '6', '查看', null, 'sys:schedule:list,sys:schedule:info', '2', null, '0'), ('8', '6', '新增', null, 'sys:schedule:save', '2', null, '0'), ('9', '6', '修改', null, 'sys:schedule:update', '2', null, '0'), ('10', '6', '删除', null, 'sys:schedule:delete', '2', null, '0'), ('11', '6', '暂停', null, 'sys:schedule:pause', '2', null, '0'), ('12', '6', '恢复', null, 'sys:schedule:resume', '2', null, '0'), ('13', '6', '立即执行', null, 'sys:schedule:run', '2', null, '0'), ('14', '6', '日志列表', null, 'sys:schedule:log', '2', null, '0'), ('15', '2', '查看', null, 'sys:user:list,sys:user:info', '2', null, '0'), ('16', '2', '新增', null, 'sys:user:save,sys:role:select', '2', null, '0'), ('17', '2', '修改', null, 'sys:user:update,sys:role:select', '2', null, '0'), ('18', '2', '删除', null, 'sys:user:delete', '2', null, '0'), ('19', '3', '查看', null, 'sys:role:list,sys:role:info', '2', null, '0'), ('20', '3', '新增', null, 'sys:role:save,sys:menu:perms', '2', null, '0'), ('21', '3', '修改', null, 'sys:role:update,sys:menu:perms', '2', null, '0'), ('22', '3', '删除', null, 'sys:role:delete', '2', null, '0'), ('23', '4', '查看', null, 'sys:menu:list,sys:menu:info', '2', null, '0'), ('24', '4', '新增', null, 'sys:menu:save,sys:menu:select', '2', null, '0'), ('25', '4', '修改', null, 'sys:menu:update,sys:menu:select', '2', null, '0'), ('26', '4', '删除', null, 'sys:menu:delete', '2', null, '0'), ('27', '1', '参数管理', 'modules/sys/config.html', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', '1', 'fa fa-sun-o', '6'), ('29', '1', '系统日志', 'modules/sys/log.html', 'sys:log:list', '1', 'fa fa-file-text-o', '7'), ('30', '1', '文件上传', 'modules/oss/oss.html', 'sys:oss:all', '1', 'fa fa-file-image-o', '6'), ('31', '1', '公司管理', 'modules/sys/dept.html', null, '1', 'fa fa-file-code-o', '1'), ('32', '31', '查看', null, 'sys:dept:list,sys:dept:info', '2', null, '0'), ('33', '31', '新增', null, 'sys:dept:save,sys:dept:select', '2', null, '0'), ('34', '31', '修改', null, 'sys:dept:update,sys:dept:select', '2', null, '0'), ('35', '31', '删除', null, 'sys:dept:delete', '2', null, '0');
COMMIT;

-- ----------------------------
--  Table structure for `sys_oss`
-- ----------------------------
DROP TABLE IF EXISTS `sys_oss`;
CREATE TABLE `sys_oss` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `url` varchar(200) DEFAULT NULL COMMENT 'URL地址',
  `create_date` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件上传';

-- ----------------------------
--  Table structure for `sys_role`
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `role_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_name` varchar(100) DEFAULT NULL COMMENT '角色名称',
  `remark` varchar(100) DEFAULT NULL COMMENT '备注',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门ID',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色';

-- ----------------------------
--  Table structure for `sys_role_dept`
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_dept`;
CREATE TABLE `sys_role_dept` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色与部门对应关系';

-- ----------------------------
--  Table structure for `sys_role_menu`
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
  `menu_id` bigint(20) DEFAULT NULL COMMENT '菜单ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色与菜单对应关系';

-- ----------------------------
--  Table structure for `sys_user`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `user_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL COMMENT '用户名',
  `password` varchar(100) DEFAULT NULL COMMENT '密码',
  `salt` varchar(20) DEFAULT NULL COMMENT '盐',
  `email` varchar(100) DEFAULT NULL COMMENT '邮箱',
  `mobile` varchar(100) DEFAULT NULL COMMENT '手机号',
  `status` tinyint(4) DEFAULT NULL COMMENT '状态  0：禁用   1：正常',
  `dept_id` bigint(20) DEFAULT NULL COMMENT '部门ID',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='系统用户';

-- ----------------------------
--  Records of `sys_user`
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', '2016-11-11 11:11:11');
COMMIT;

-- ----------------------------
--  Table structure for `sys_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  `role_id` bigint(20) DEFAULT NULL COMMENT '角色ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户与角色对应关系';

-- ----------------------------
--  Table structure for `sys_user_token`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_token`;
CREATE TABLE `sys_user_token` (
  `user_id` bigint(20) NOT NULL,
  `token` varchar(100) NOT NULL COMMENT 'token',
  `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `token` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统用户Token';

-- ----------------------------
--  Records of `sys_user_token`
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_token` VALUES ('1', '83d7ea5aa61b0b8552c6baff3251c05e', '2017-10-18 23:26:41', '2017-10-18 11:26:41');
COMMIT;

-- ----------------------------
--  Table structure for `tb_token`
-- ----------------------------
DROP TABLE IF EXISTS `tb_token`;
CREATE TABLE `tb_token` (
  `user_id` bigint(20) NOT NULL,
  `token` varchar(100) NOT NULL COMMENT 'token',
  `expire_time` datetime DEFAULT NULL COMMENT '过期时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `token` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户Token';

-- ----------------------------
--  Table structure for `tb_user`
-- ----------------------------
DROP TABLE IF EXISTS `tb_user`;
CREATE TABLE `tb_user` (
  `user_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL COMMENT '用户名',
  `mobile` varchar(20) NOT NULL COMMENT '手机号',
  `password` varchar(64) DEFAULT NULL COMMENT '密码',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户';

-- ----------------------------
--  Records of `tb_user`
-- ----------------------------
BEGIN;
INSERT INTO `tb_user` VALUES ('1', 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', '2017-03-23 22:37:41');
COMMIT;

-- ----------------------------
--  Procedure structure for `base_data_init`
-- ----------------------------
DROP PROCEDURE IF EXISTS `base_data_init`;
delimiter ;;
CREATE DEFINER=`lslease`@`%` PROCEDURE `base_data_init`()
BEGIN
	INSERT INTO app_sys_role(name, type, remark) VALUES('未知角色', -1, '添加角色');
	INSERT INTO app_sys_role(name, type, remark) VALUES('系统用户', 1, '添加角色');
	INSERT INTO app_sys_role(name, type, remark) VALUES('租客', 2, '添加角色');
	INSERT INTO app_sys_role(name, type, remark) VALUES('房东', 4, '添加角色');
	INSERT INTO app_sys_role(name, type, remark) VALUES('既是租客也是房东', 8, '添加角色');
END
 ;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;
